package com.tangyuan.answer.mapper;

import com.tangyuan.model.AnswerCollent;
import com.tangyuan.model.AnswerObject;
import com.tangyuan.model.Answertopaper;
import com.tangyuan.vo.AnswerCollentVo;
import com.tangyuan.vo.AnswerObjectVo;
import com.tangyuan.vo.AnswertopaperVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface AnswerMapper  {


    List<AnswerCollentVo> getAnswer(@Param("userId") Long userId, @Param("answerObjectId") Long answerObjectId,@Param("gradeId") Long gradeId);

    void addObject(Long id, String name, Date createTime);

    List<AnswerObjectVo> getObject(Long id);

    void removeObject(Long id, List<Long> list);

    void serAnswerName(@Param("userId") Long userId, @Param("name") String name, @Param("id") Long id);

    void removeAnswerName(@Param("userId") Long userId, @Param("id") Long id);

    void addObjectNum(Long answerObjectId, Long id);


    AnswerObjectVo getSingleObject(@Param("userId") Long userId, @Param("id") Long id);


    long getAnswerNum(@Param("userId") Long userId, @Param("id") Long id);


    AnswerObject getObjectByName(@Param("id") Long id, @Param("name") String name);


    void addAnswer(List<AnswerCollent> list1);

    void updateAnswer(@Param("id") Long id, @Param("userId") Long userId, @Param("answerObjectId") Long answerObjectId,@Param("gradeId") Long gradeId, @Param("answerImage") String answerImage);

    AnswerCollent getAnswerById(@Param("id") Long id);

    void savePaper(Answertopaper answertopaper);

    List<AnswertopaperVo> getPaper(Long id);

    Long getPaperNum(@Param("userId") Long userId, @Param("id") Long id);

    List<AnswertopaperVo> getPaperById(@Param("userId") Long userId, @Param("objectId") Long objectId,@Param("gradeId") Long gradeId);

    void removePaperById(Long id);


    List<AnswerObjectVo> getAllObjectByUserId(Long userId);


    List<AnswerObjectVo> getFirstObjectByUserId(Long userId);

    List<AnswerCollentVo> getAnswerByGrade(Long userId, Long answerObjectId, Long gradeId);
}
